package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.StrategyLike;
import cn.wolfcode.trip.base.domain.SystemNews;
import cn.wolfcode.trip.base.mapper.SystemNewsMapper;
import cn.wolfcode.trip.base.query.LikeQueryObject;
import cn.wolfcode.trip.base.service.ISystemNewsService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ISystemNewsServiceImp implements ISystemNewsService {

    @Autowired
    private SystemNewsMapper systemNewsMapper;

    public int countForSystemNews(Long userId) {
        return systemNewsMapper.countForSystemNews(userId);
    }

    public PageInfo<SystemNews> selectListForSystemNew(LikeQueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize(), qo.getOrderBy());
        List<SystemNews> list = systemNewsMapper.ListForLikeComment(qo);
        return new PageInfo(list);
    }
}
